package _SED.client;

import java.util.Date;
import java.util.List;

//import com.google.appengine.api.datastore.Entity;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * The async counterpart of <code>GreetingService</code>.
 */
public interface DBConnectionAsync {

	// Users
	void userAuth(String user, String pwd, AsyncCallback<String[]> callback)
			throws IllegalArgumentException;

	void userCreate(String usr, String lname, String fname, String role,
			String pwd, AsyncCallback<String> asyncCallback)
			throws IllegalArgumentException;

	void userChange(String usr, String lname, String fname, String role,
			String pwd, AsyncCallback<String> asyncCallback)
			throws IllegalArgumentException;

	void userDelete(String usr, AsyncCallback<String> asyncCallback)
			throws IllegalArgumentException;

	void getUsers(AsyncCallback<String[]> asyncCallback)
			throws IllegalArgumentException;

	void getCO(AsyncCallback<String[]> asyncCallback)
			throws IllegalArgumentException;

	void getCA(AsyncCallback<String[]> asyncCallback)
			throws IllegalArgumentException;

	void getCI(AsyncCallback<String[]> asyncCallback)
			throws IllegalArgumentException;

	void getCD(AsyncCallback<String[]> asyncCallback)
			throws IllegalArgumentException;

	void getUser(String usr, AsyncCallback<String[]> asyncCallback)
			throws IllegalArgumentException;

	// RFC's

	void getNextRfcNr(AsyncCallback<Long> asyncCallback)
			throws IllegalArgumentException;

	void fetchRfc(int start, int length, AsyncCallback<List<Rfc>> callback);

	void createRFC(long id, String reason, String desc, String detaildesc,
			Date validFrom, String CI, String CO, String CA, String prio,
			String cost, String benefit, String risk, String service,
			String cItems, AsyncCallback<String> asyncCallback)
			throws IllegalArgumentException;

	void changeRfc(long id, String reason, String desc, String detaildesc,
			Date validFrom, Date approvedOn, Date solvedOn, Date closedOn, Date startedOn,
			String CI, String CO, String CA, String CD, String prio,
			String cost, String benefit, String risk, String service,
			String cItems, String state, AsyncCallback<String> asyncCallback)
			throws IllegalArgumentException;

	void deleteAllRfcs(AsyncCallback<String> asyncCallback)
			throws IllegalArgumentException;

	// WO
	void fetchWO(int start, int length, AsyncCallback<List<WO>> callback) throws IllegalArgumentException;
	
	void getWO(long id, AsyncCallback<WO> callback) throws IllegalArgumentException;

	void createWO(long id, Date planedStart, String CD, String CO, String woType,
			String desc, String serv, String cItem, AsyncCallback<String> asyncCallback)
			throws IllegalArgumentException;
	
	void changeWO(long id, Date planedStart, Date planedEnd, Date actStart, Date actEnd,
			String planedEffort, String CD, String CO, String woType,
			String desc, String serv, String cItem, String state,
			AsyncCallback<String> asyncCallback)
			throws IllegalArgumentException;

}
